home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_shs_bnladder.cog < prev    next >
Text File  |  1999-11-15  |  4KB  |  182 lines

  1. # Jones 3D Cog Script
  2. #
  3. # shs_BNladder.cog      Make the Big Nave ladder move.  
  4. #
  5. # [JWC, RKD]
  6. #
  7. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ========================================================================================
  10.  
  11. symbols
  12.  
  13. message activated
  14. message    startup
  15.  
  16. sound    ladderstart=shs_ladderroll_start.wav        local
  17. sound    laddermove=shs_ladderroll_c.wav                local
  18. sound    ladderstop=shs_ladderroll_stop.wav            local
  19.  
  20. surface    LowerClimb0            # set as no move due to ladder pos
  21. surface    LowerClimb1               
  22. surface    UpperClimb0             # set as not climable in marcus
  23. surface    UpperClimb1
  24.  
  25. thing    ladder0                          
  26. thing   door                   
  27. thing   button0                                                  
  28. thing    player                local
  29. thing    cam1
  30. thing    c1_t1
  31. thing    c1_t2
  32.  
  33. int        curcam                local
  34. int     moving=0             local    # prevents multiple activates
  35. int        ladderpos=0            local    # 0=down, 1=up    
  36. int        ladderloop            local
  37.  
  38. #SUBROUTINES
  39. flex    ladderup            local
  40. flex    ladderdown            local
  41. flex    returncontrol        local
  42.  
  43. end
  44.  
  45. # ========================================================================================
  46.  
  47. code
  48. startup:
  49.  
  50.     player= GetLocalPlayerThing();
  51.     return;
  52.  
  53. activated:
  54.                 
  55.     if (GetCurItem(player) != 0) return; # prevents activating with chalk
  56.  
  57.     if ((GetSenderRef() == button0) && (moving == 0))
  58.     {
  59.                                                     
  60.         #Prep..
  61.         
  62.         SetActorFlags(player, 0x200000);
  63.         StartCutscene(0);
  64.         StopThing(player);
  65.         DeselectWeapon(player);
  66.         DeselectWeaponWait(player);
  67.           
  68.         # cut to indy
  69.         curCam = GetCurrentCamera();   
  70.         SetCameraLookInterp(2, 0); # no pan & tilt
  71.         SetCameraPosInterp(2, 0); # no dolly
  72.         SetCameraFocus(2, cam1);
  73.         SetCameraSecondaryFocus(2, c1_t1);
  74.         Sleep(0.01);
  75.         SetCurrentCamera(2);
  76.         SetCameraFOV(70, 0, 0);
  77.          
  78.         moving=1;
  79.         PlayMode(player, 60, 0); # push button anim
  80.         Sleep(.3); # synch with button
  81.  
  82.         MoveToFrame(button0, 1, 1);
  83.         WaitForStop(button0);
  84.              
  85.         # cut to ladder
  86.         SetCameraLookInterp(2, 1); # pan & tilt
  87.         SetCameraInterpSpeed(2, 2.5);
  88.         Sleep(0.01);
  89.         SetCameraSecondaryFocus(2, c1_t2);
  90.         SetCameraFOV(50, 1, 2.5);
  91.         sleep(1);
  92.  
  93.         if (ladderpos == 0)
  94.         {
  95.             Call ladderup;
  96.         }
  97.         else    
  98.         {
  99.             Call ladderdown;
  100.         }
  101.         
  102.         MoveToFrame(button0, 0, 1);
  103.         WaitForStop(button0);
  104.         Sleep(.5);
  105.  
  106.         Call returncontrol;
  107.  
  108.         moving=0;
  109.     }
  110.     return;
  111.     
  112.    
  113. ladderup:
  114.  
  115.     # set bits on upper/lower surfaces
  116.     ClearAdjoinFlags(UpperClimb0, 0x2);
  117.     ClearAdjoinFlags(UpperClimb1, 0x2);
  118.  
  119.     SetSurfaceFlags(UpperClimb0, 0x2000);
  120.     SetSurfaceFlags(UpperClimb1, 0x2000);
  121.     
  122.     SetAdjoinFlags(LowerClimb0, 0x2);
  123.     SetAdjoinFlags(LowerClimb1, 0x2);
  124.     
  125.     # move ladder to upper
  126.     Print("ladder to roof");
  127.     PlaySoundLocal(ladderstart, 1.0, 0, 0x0000, 0);    
  128.     MoveToFrame(ladder0, 1, 2);    
  129.     ladderloop=PlaySoundLocal(laddermove, 1.0, 0, 0x1, 0);
  130.     WaitForStop(ladder0);
  131.     StopSound(ladderloop, 0.0);
  132.     PlaySoundLocal(ladderstop, 1.0, 0, 0x0000, 0);
  133.     Rotate(door,-90, 0, 1);
  134.     MoveToFrame(button0, 0, 1);
  135.     WaitForStop(button0);
  136.     ladderpos=1;
  137.     return;
  138.     
  139.     
  140. ladderdown:
  141.  
  142.     # set bits on upper/lower surfaces
  143.     SetAdjoinFlags(UpperClimb0, 0x2);
  144.     SetAdjoinFlags(UpperClimb1, 0x2);
  145.     ClearSurfaceFlags(UpperClimb0, 0x2000);
  146.     ClearSurfaceFlags(UpperClimb1, 0x2000);
  147.     ClearAdjoinFlags(LowerClimb0, 0x2);
  148.     ClearAdjoinFlags(LowerClimb1, 0x2);
  149.     
  150.     # move ladder down
  151.     PlaySoundLocal(ladderstart, 1.0, 0, 0x0000, 0);    
  152.     Rotate(door, 90, 0, 1);
  153.     WaitForStop(door);
  154.     MoveToFrame(ladder0, 0, 2);    
  155.     ladderloop=PlaySoundLocal(laddermove, 1.0, 0, 0x1, 0);
  156.     WaitForStop(ladder0);
  157.     StopSound(ladderloop, 0.0);
  158.     PlaySoundLocal(ladderstop, 1.0, 0, 0x0000, 0);
  159.     MoveToFrame(button0, 0, 1);
  160.     WaitForStop(button0);
  161.     ladderpos=0;
  162.     
  163.      return;
  164.  
  165.  
  166. returncontrol:
  167.         
  168.     SetCameraPosition(1, GetThingPos(cam1)); # prep to swing back to follow-cam
  169.     SetCameraLookInterp(2, 0); # kill pan & tilt mode
  170.     SetCameraPosInterp(2, 0); # kill dolly mode
  171.     sleep(.01);
  172.     ResetCameraFOV(0, 0.0);
  173.     SetCurrentCamera(curCam);  
  174.     ClearActorFlags(player, 0x200000);
  175.     EndCutscene();
  176.     
  177. return;
  178.  
  179.  
  180. end
  181.  
  182.